<div class="tableToolbar">
    <div class="coll-md-8" id="addInput">
        <div class="coll-md-2">
            <input type="text" class='search' placeholder="用户名/姓名/流水号/手机号" ng-model="ctrlScope.itemsearch.commonCond">
        </div>
        <div class="coll-md-3 scalenone" id="search2">
            <div class="coll-md-5 triangle">
                <select class="form-control" ng-model="ctrlScope.itemsearch.type">
                    <option selected value="" disabled hidden >类型</option>
                    <option value="1">APP充值</option>
                    <option value="2">后台充值</option>
                    <option value="3">网页端充值</option>
                    <option value="4">微信端充值</option>
                </select>
            </div>
            <div class="coll-md-5 triangle">
                <select class="form-control" ng-model="ctrlScope.itemsearch.status">
                    <option selected value="" disabled hidden>状态</option>
                    <option value="0">失败</option>
                    <option value="1">成功</option>
                    <option value="2">审核中</option>
                </select>
            </div>
        </div>
        <div class="coll-md-4 scalenone"  id="searchdate" datahide>
            <div class="coll-md-5" >
                <p class="input-group">
                    <input type="text" class="search" placeholder="添加开始时间" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="ctrlScope.itemsearch.beginDateTimex" is-open="popup1.opened" datepicker-options="dateOptions"/>
						<span class="input-group-btn">
							            <button type="button" class="small-icon btn btn-default" ng-click="open1()"><i
                                                class="glyphicon glyphicon-calendar"></i></button>
							          </span>
                </p>
            </div>
            <div class="coll-md-5">
                <p class="input-group inline">
                    <input type="text" class="search" placeholder="添加结束时间" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="ctrlScope.itemsearch.endDateTimex" is-open="popup2.opened" datepicker-options="dateOptions"/>
						<span class="input-group-btn">
							            <button type="button" class="small-icon btn btn-default" ng-click="open2()"><i
                                                class="glyphicon glyphicon-calendar"></i></button>
							          </span>
                </p>
            </div>
        </div>
        <div class="coll-md-1">
            <input type="button" class="small-icon search2-icon" value="搜索" ng-click="search()">
            <input type="button" class="small-icon search2" value="搜索">
            <input type="button" class="small-icon reset-icon" reset-icon value="重置" ng-click="reset()">
            <input type="button" class="small-icon reset" value="重置">

            <div class="dropdown-menu-right">
                <input type="button" class="small-icon more-icon" value="更多" title='更多搜索项' id="more-icon" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false">
                <input type="button" class="small-icon more" value="更多">
                <ul class="dropdown-menu" style='margin-left:80px;' aria-labelledby="dropdownMenu2" more-search>
                    <li><a href="javascript:;">日期搜索</a></li>
                    <li><a href="javascript:;">类型状态搜索</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="coll-md-2">
        <!--<input type="button" class="bttn pos-left"  ng-click="addOrderModal()" value="新建">-->
        <button class="small-icon btn btn-default pos-right" id="itemExport" ng-click="download()">
            <i class="fa fa-download" ></i>
        </button>
    </div>
</div>
<table  style="margin-bottom:20px;width: 60%">
    <tr>
        <td class="blue">
        <h6>APP充值</h6>
        <h4>{{show.APPRecharge}}元</h4>
    </td>
        <td class="red">
            <h6>平台充值</h6>
            <h4>{{show.platformRecharge}}元</h4>
        </td>
        <td class="blue">
            <h6>微信充值</h6>
            <h4>{{show.webRecharge}}元</h4>
        </td>
        <td class="red">
            <h6>网站充值</h6>
            <h4>{{show.wechatRecharge}}元</h4>
        </td>
    </tr>
</table>
<!--<table  style="margin-bottom:20px;table-layout: fixed;width:60%">-->
    <!--<tr>-->
        <!--<td ng-class="{true:'blue',false:'red'}[$index % 2 == 0]" ng-repeat="list in data" style="width:15%;">-->
            <!--<h6>{{list.resource}}</h6>-->
            <!--<h4>{{list.rechargeAmount}}元</h4>-->
        <!--</td>-->
    <!--</tr>-->
<!--</table>-->

<table ui-table="orderParams">
    <thead>
    <tr>
        <th>用户名</th>
        <th>真实姓名</th>
        <th>手机号</th>
        <th>订单号</th>
        <th>充值金额(元)</th>
        <th>到账金额(元)</th>
        <th>手续费(元)</th>
        <th>充值类型</th>
        <th>充值来源</th>
        <th>充值状态</th>
        <th>添加时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr ng-repeat="item in orderParams.$rows">
        <td>
            <span ng-if="item.username">{{item.username}}</span>
            <span ng-if="item.sysUsername">{{item.sysUsername}}</span>
        </td>
        <td>{{item.realname}}</td>
        <td>{{item.mobile}}</td>
        <td>{{item.orderNo}}</td>
        <td>{{item.rechargeAmount}}</td>
        <td>{{item.actualAmount}}</td>
        <td>{{item.feeAmount}}</td>
        <td>{{item.rechargeType | rechargeType}}</td>
        <td>{{item.rechargeResource}}</td>
        <td>{{item.rechargeStatus | rechargeStatus}}</td>
        <td>{{item.addtime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
        <!--<td>-->
        	<!--<a  ng-click="modifyModal(item.orderNo)">编辑</a>-->
        <!--</td>-->
        <td>
            <a   ng-click="openCheckModal(item.orderNo,item.rechargeAmount,item.rechargeStatus)">订单查询</a>
        </td>
    </tr>
    </tbody>
</table>
<modal title="新建" visible="addModal">
    <form class="form-horizontal" role="form" name="myForm" ng-submit="adoptAdd(myForm.$valid)" novalidate>
        <div class="form-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">手机号码：</label>
                        <div class="col-md-8">
                            <input  style='width:65%;float:left' type="text" class="form-control" ng-model="add.username" required  ng-blur="isRegister(add.username)"><input style="width:30%;float: right" ng-model="add.realname" placeholder="真实姓名" readonly/>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">充值来源：</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control"  readonly ng-model="add.resource" />
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">充值金额：</label>
                        <div class="col-md-8 yuan">
                            <input type="text" class="form-control" ng-model="add.newRechargeAmount" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">账户类型：</label>
                        <div class="col-md-8">
                            <select class="form-control" ng-model="add.type" ui-select2="select2Options" required>
                                <option value="" disabled hidden selected>请选择</option>
                                <option value="1">投资人</option>
                                <option value="2">借款人</option>
                                <option value="4">投资借款人</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="control-label col-md-2">备注：</label>
                        <div class="col-md-10">
                            <textarea ng-model="add.remark" class="form-control"></textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="buttonArea col-md-12">
                <button type="submit" class="btn blue" ng-disabled="myForm.$invalid">确认</button>
            </div>

        </div>
    </form>
</modal>
<modal title="编辑" visible="detailsModal">
    <form class="form-horizontal">
        <div class="form-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">订单号：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="list.orderNo" readonly>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">用户真实姓名：</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="list.realname" readonly>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">联系电话：</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="list.mobile" readonly>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">充值金额：</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="list.rechargeAmount" readonly>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">到账金额：</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="list.actualAmount" readonly>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">手续费：</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="list.feeAmount" readonly>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">充值类型：</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-value="list.rechargeType | rechargeType" readonly>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">状态</label>
                        <div class="col-md-8 triangle-left">
                        	<select ng-model="list.rechargeStatus"  ui-select2="select2Options" class="form-control">
                        		<option value="2">审核中</option>
                        		<option value="1">成功</option>
                        		<option value="0">失败</option>
                        	</select>
                        </div>
                    </div>
                </div>
                <input type="hidden" ng-model="rechargeStatus" />
            </div>
            <div class="buttonArea col-md-12">
                <button type="submit" class="btn blue" ng-click="saveSubmit(rechargeStatus)" >保存</button>
            </div>
        </div>
    </form>
</modal>
<modal title="查询订单" visible="checkModal">
    <form class="form-horizontal" role="form" name="myForm" novalidate ng-submit="addItem(myForm.$invalid)">
        <div class="form-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">查询结果：</label>
                        <div class="col-md-8" style="line-height: 36px;">
                            {{add.respSubdes}}
                        </div>
                    </div>
                </div>
                <div class="col-md-6">

                </div>
            </div>
            <div class="row">

                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">补单状态：</label>
                        <div class="col-md-8">
                            <select class="form-control" ng-model="add.status" ui-select2="select2Options" disabled>
                                <option value="F">失败</option>
                                <option value="S">成功</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">密码：</label>
                        <div class="col-md-8">
                            <input class="form-control" type="password" ng-model="add.password" required>
                        </div>
                    </div>
                </div>
            </div>
           <div class="buttonArea col-md-12" ng-if="add.status == 'S' && status != 1">
                <button type="submit" class="btn blue" ng-disabled="myForm.$invalid">补单</button>
            </div>

        </div>
    </form>
</modal>
